#include "gtkactionable.h"
#include "gtkactionmuxerprivate.h"
#include "gtkbutton.h"
+#include "gtkcolorswatchprivate.h"
#include "gtkentryprivate.h"
#include "gtkexpander.h"
#include "gtkmodelbuttonprivate.h"
};
/* }}} */
-
/* {{{ GtkSwitch */
static const Action switch_actions[] = {
};
/* }}} */
+/* {{{ GtkColorSwatch */
+static gboolean
+color_swatch_select (GtkAtSpiContext *self)
+{
+ GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
+ gtk_color_swatch_select (GTK_COLOR_SWATCH (accessible));
+ return TRUE;
+}
+
+static gboolean
+color_swatch_activate (GtkAtSpiContext *self)
+{
+ GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
+ gtk_color_swatch_activate (GTK_COLOR_SWATCH (accessible));
+ return TRUE;
+}
+
+static gboolean
+color_swatch_customize (GtkAtSpiContext *self)
+{
+ GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
+ gtk_color_swatch_customize (GTK_COLOR_SWATCH (accessible));
+ return TRUE;
+}
+
+static gboolean
+color_swatch_is_enabled (GtkAtSpiContext *self)
+{
+ GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self));
+ return gtk_color_swatch_get_selectable (GTK_COLOR_SWATCH (accessible));
+}
+
+static const Action color_swatch_actions[] = {
+ {
+ .name = "select",
+ .localized_name = NC_("accessibility", "Select"),
+ .description = NC_("accessibility", "Selects the color"),
+ .keybinding = "<Return>",
+ .activate = color_swatch_select,
+ .is_enabled = color_swatch_is_enabled,
+ },
+ {
+ .name = "activate",
+ .localized_name = NC_("accessibility", "Activate"),
+ .description = NC_("accessibility", "Activates the color"),
+ .keybinding = "<VoidSymbol>",
+ .activate = color_swatch_activate,
+ .is_enabled = color_swatch_is_enabled,
+ },
+ {
+ .name = "customize",
+ .localized_name = NC_("accessibility", "Customize"),
+ .description = NC_("accessibility", "Customizes the color"),
+ .keybinding = "<VoidSymbol>",
+ .activate = color_swatch_customize,
+ .is_enabled = color_swatch_is_enabled,
+ },
+};
+
+static void
+color_swatch_handle_method (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ GtkAtSpiContext *self = user_data;
+
+ action_handle_method (self, method_name, parameters, invocation,
+ color_swatch_actions,
+ G_N_ELEMENTS (color_swatch_actions));
+}
+
+static GVariant *
+color_swatch_handle_get_property (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *property_name,
+ GError **error,
+ gpointer user_data)
+{
+ GtkAtSpiContext *self = user_data;
+
+ return action_handle_get_property (self, property_name, error,
+ color_swatch_actions,
+ G_N_ELEMENTS (color_swatch_actions));
+}
+static const GDBusInterfaceVTable color_swatch_action_vtable = {
+ color_swatch_handle_method,
+ color_swatch_handle_get_property,
+ NULL,
+};
+/* }}} */
/* {{{ GtkExpander */
static const Action expander_actions[] = {
};
/* }}} */
-
/* {{{ GtkEntry */
static gboolean is_primary_icon_enabled (GtkAtSpiContext *self);
};
/* }}} */
-
/* {{{ GtkPasswordEntry */
static gboolean is_peek_enabled (GtkAtSpiContext *self);
return &password_entry_action_vtable;
else if (GTK_IS_SWITCH (accessible))
return &switch_action_vtable;
+ else if (GTK_IS_COLOR_SWATCH (accessible))
+ return &color_swatch_action_vtable;
else if (GTK_IS_WIDGET (accessible))
return &widget_action_vtable;
return NULL;
}
+
+/* vim:set foldmethod=marker expandtab: */